home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 5 Apr 1996
- // Author: ms
- //
- // Description:
- // This procedure selects history/future of the object
-
- proc string needTheLead()
- {
- string $result = "";
- string $all[] = `ls -l -sl -tail 1 -type dagNode`;
- if( size($all) > 0 ) {
- $result = $all[0];
- }
- else {
- $all = `ls -sl -tail 1`;
- if( size($all) > 0 ) {
- $result = $all[0];
- }
- }
- return $result;
- }
-
-
- proc string fillOutSection( string $chain[] )
- {
- string $cmdString = "";
- string $item, $each;
- string $list[];
- int $n;
-
- for( $item in $chain ) {
- tokenize( $item, "|", $list );
- $n = size($list);
- if( 1 == $n ) {
- $cmdString = ( $cmdString + " \"" + $item + "\"" );
- }
- else if( $n > 0 ) {
- for( $each in $list ) {
- $cmdString = ( $cmdString + " \"" + $each + "\"" );
- }
- }
- }
-
- return $cmdString;
- }
-
- proc string selectInputOutputGiven( string $lead, int $future )
- {
- string $chainFalse[];
- string $chainTrue[];
- string $cmdString;
-
- int $showLevel = 2;
- int $pruneDag = 1;
-
- if( "" != $lead ) {
- if( "transform" == `nodeType $lead`) {
- $chainFalse2 = `listHistory -gl true -pdo $pruneDag -lf false
- -f $future -il $showLevel $lead`;
- $cmdString = fillOutSection( $chainFalse2 );
- }
- $chainTrue2 = `listHistory -gl true -pdo $pruneDag -lf true
- -f $future -il $showLevel $lead`;
- $cmdString = $cmdString + fillOutSection( $chainTrue2 );
-
- eval( "select -add " + $cmdString + "");
- }
- return $cmdString;
- }
-
- global proc string selectAllInputOutput( int $future )
- //
- // Select all objects in the history (input) if flag is false
- // or future (output) if flag is true of the lead object selected.
-
- {
- // Get the list of selected items and do the list
- // for the lead/last item.
- //
- return selectInputOutputGiven( `needTheLead`, $future );
- }
-